package com.dotstone.chipism.activity;

import com.dotstone.chipism.R;
import com.dotstone.chipism.ui.security.me.AddCameraOnclickActivity;
import com.dotstone.chipism.view.slidingfragmenu.BarUtils;

import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class AddTypeSelectionActivity extends BaseActivity {
	private LinearLayout mBackL;
	private TextView mTitleT;
	private Button mWlanBtn;
	private Button mDeviceBtn;
	private Button mCameraBtn;
//	private Button mRemoteB;
	private TextView tv_statusBar_mian;
	public static AddTypeSelectionActivity addTypeSelectionActivity;
	private int entry;
	@Override
	public void widgetClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.back_layout:
			finish();
			break;
		case R.id.wlan_btn:
			Intent intent = new Intent(AddTypeSelectionActivity.this,
					PairWlanActivity.class);
			intent.putExtra("entry", entry);
			startActivity(intent);
//			finish();
			break;
		case R.id.device_btn:
			Intent intent1 = new Intent(AddTypeSelectionActivity.this,
					WlanSelectionActivity.class);
			intent1.putExtra("entry", entry);
			startActivity(intent1);
//			finish();
			break;
			//添加摄像头
		case R.id.camera_btn:

			startActivity(new Intent(getApplicationContext() , AddCameraOnclickActivity.class));
			break;

		default:
			break;
		}
	}

	@Override
	public void initParms(Bundle parms) {
		// TODO Auto-generated method stub

	}

	@Override
	public View bindView() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int bindLayout() {
		// TODO Auto-generated method stub
		return R.layout.activity_add_type_selection;
	}

	@Override
	public void initView(View view) {
		// TODO Auto-generated method stub
		addTypeSelectionActivity = this;
		mBackL = $(R.id.back_layout);
		mWlanBtn = $(R.id.wlan_btn);
		mDeviceBtn = $(R.id.device_btn);
		mCameraBtn = $(R.id.camera_btn);
		mTitleT = $(R.id.title_tv);
//		mRemoteB = $(R.id.remote_btn);
		mTitleT.setVisibility(View.GONE);
		tv_statusBar_mian = $(R.id.tv_statusBar_mian);
		mBackL.setOnClickListener(this);
		mWlanBtn.setOnClickListener(this);
		mDeviceBtn.setOnClickListener(this);
		mCameraBtn.setOnClickListener(this);
//		mRemoteB.setOnClickListener(this);
		entry = getIntent().getIntExtra("entry", 0);
		boolVersion();
	}

	public void boolVersion() {
		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {

			Window window = getWindow();
			window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
					WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
			// 透明导航栏
//			getWindow().addFlags(
//					WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
			// 改变titlebar的高度
			int statusbarHeight = BarUtils.getStatusBarHeight(this);
			RelativeLayout.LayoutParams layoutParams1 = (RelativeLayout.LayoutParams) tv_statusBar_mian
					.getLayoutParams();
			layoutParams1.height = statusbarHeight;
			tv_statusBar_mian.setLayoutParams(layoutParams1);
			tv_statusBar_mian.setVisibility(View.VISIBLE);
		} else {
			tv_statusBar_mian.setVisibility(View.GONE);
		}
	}

	@Override
	public void setListener() {
		// TODO Auto-generated method stub

	}

	@Override
	public void doBusiness(Context mContext) {
		// TODO Auto-generated method stub

	}

}
